package com.training.food.controller;

import com.training.food.pojo.Check;
import com.training.food.service.CheckService;
import com.training.food.util.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
public class CheckController {
    //添加检验信息
    @Resource
    CheckService checkService;
    @PostMapping("/food/buy/addCheck")
    public CommonResult AddCheck(HttpServletRequest request, @RequestBody Check check){
        //System.out.println(check);

        checkService.add(check);
        return CommonResult.success("增加检疫信息成功");
    }
    //删除检验信息
    @PostMapping("/food/buy/deleteCheck")
    public CommonResult SubCheck(HttpServletRequest request,@RequestBody Check check){

        checkService.sub(check);
        return CommonResult.success("删除检疫信息成功");
    }
}
